<LayoutEditFormBox :loading="load">
    <template slot="main">
        <!-- 添加原因对话框 -->
        <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="添加原因"
            :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
            <el-input v-model="reason" placeholder="请输入售后原因内容"></el-input>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="createReason();">确 定</el-button>
            </span>
        </el-dialog>
        <el-form ref="editForm" :model="form" label-width="200px" label-position="left">

            <LayoutCell>
                <LayoutCellItem title="基础">

                    <el-form-item label="买家留言提示语" prop="buyerMessage" :rules="{ required: true, message: '不能为空'}">
                        <el-col :span="8">
                            <el-input v-model="form.buyerMessage" maxlength="50"></el-input>
                        </el-col>
                    </el-form-item>
                    <el-form-item label="未支付订单" prop="orderAutoCloseTime"
                        :rules="[{ required: true,trigger: ['blur', 'change'],validator:function(rule, value, callback){validatorNumber(rule, value, callback)}}]">
                        <el-input-number controls-position="right" :min="0" v-model="form.orderAutoCloseTime">
                        </el-input-number><span class="s1">分钟后</span><span class="s1">自动关闭</span>
                    </el-form-item>
                    <el-form-item label="已发货订单" prop="orderAutoReceiveTime" :rules="{ required: true, message: '不能为空'}">
                        <el-input-number controls-position="right" :precision="0" v-model="form.orderAutoReceiveTime">
                        </el-input-number><span class="s1">天后</span><span class="s1">自动确认收货</span>
                    </el-form-item>
                    <el-form-item label="已收货订单" prop="orderCloseRefundTime" :rules="{ required: true, message: '不能为空'}">
                        <el-input-number controls-position="right" :precision="0" v-model="form.orderCloseRefundTime"
                            :max="365" :min="0">
                        </el-input-number><span class="s1">天后</span><span class="s1">关闭退款/退货功能</span><span
                            class="s1">填写则买家可在确认收货后进行退款/退货申请，最长可设置365天，0代表确认收货后无法售后</span>
                    </el-form-item>
                    <!-- <el-form-item label="默认支付方式" prop="defaultPayMethodType" :rules="{ required: true, message: '请选择'}">
                        <el-radio-group v-model="form.defaultPayMethodType">
                            <el-radio :label="1">优先选中线上支付</el-radio>
                            <el-radio :label="2">优先选中线下支付</el-radio>
                        </el-radio-group>
                    </el-form-item> -->
                    <el-form-item label="规格库存不足处理方式" prop="underStockDealType"
                        :rules="{ required: true, message: '请选择'}">
                        <el-radio-group v-model="form.underStockDealType">
                            <el-radio :label="1">允许扣成负库存</el-radio>
                            <el-radio :label="2">整个订单自动售后</el-radio>
                        </el-radio-group>
                    </el-form-item>

                </LayoutCellItem>

                <LayoutCellItem title="其他">

                    <el-form-item label="售后原因" prop="showRightsReason" :rules="{ required: true, message: '请选择'}">
                        <el-switch v-model="form.showRightsReason" style="margin-right:10px" :active-value="1"
                            :inactive-value="0"></el-switch>
                        <div class="tagList">
                            <el-tag class="tagStyle" v-if="form.showRightsReason"
                                v-for="tag in form.rightsReasonSettingLst" :key="tag.id" closable
                                @close="deleteReason(tag)">
                                {{tag.reason}}
                            </el-tag>
                        </div>
                        <el-button @click="dialogVisible = true;reason=''" v-if="form.showRightsReason"
                            icon="el-icon-circle-plus-outline">添加原因</el-button>
                    </el-form-item>

                    <el-form-item label="发货后支持的售后方式">
                        <el-checkbox v-model="form.isOnlyRefund" :true-label="1" :false-label="0">仅退款</el-checkbox>
                        <el-checkbox v-model="form.isOnlyRefundProduct" :true-label="1" :false-label="0">
                            退货退款，无需物流商品仅支持退款
                        </el-checkbox>
                    </el-form-item>

                </LayoutCellItem>

            </LayoutCell>


        </el-form>
    </template>
    <template slot="footer">
        <el-button type="primary" @click="submit()">确定</el-button>
    </template>
</LayoutEditFormBox>